[FusedRMSNorm doc] document where epsilon is added#1295
Merged
crcrpar merged 3 commits intoNVIDIA:masterfrom Feb 11, 2022
Merged
[FusedRMSNorm doc] document where epsilon is added#1295crcrpar merged 3 commits intoNVIDIA:masterfrom
crcrpar merged 3 commits intoNVIDIA:masterfrom
Conversation
Collaborator
|
I'm not sure this formula is accurate, as the epsilon value is used during the computation of the root-mean-square: apex/csrc/layer_norm_cuda_kernel.cu Line 378 in e1aa1fc |
Contributor
Author
|
Thank you for catching that, @eqy. You're correct - perhaps we just document this nuance as in my last edit? |
eqy
approved these changes
Feb 11, 2022
Collaborator
|
thank you @stas00 |
crcrpar
approved these changes
Feb 11, 2022
hubertlu-tw
pushed a commit
to ROCm/apex
that referenced
this pull request
Apr 15, 2022
* [FusedRMSNorm doc] add epsilon to formula * correct * better wording
jithunnair-amd
pushed a commit
to ROCm/apex
that referenced
this pull request
Aug 5, 2022
* FusedRMSNorm/"T5LayerNorm" based on FusedLayerNorm (NVIDIA#1274) * FusedRMSNorm based on FusedLayerNorm * refactor duplicated kernels * delete comments * delete comments * cleanup * cleanup * cleanup, fixed clobbering forward_affine_mixed_dtypes * fix pybind naming and add MixedFused test * undo skipping * check elementwise_affine * Update tests/L0/run_fused_layer_norm/test_fused_layer_norm.py Oof, nice catch, thanks Co-authored-by: Masaki Kozuki <masaki.kozuki.2014@gmail.com> Co-authored-by: Masaki Kozuki <masaki.kozuki.2014@gmail.com> * fix and generate docs for FusedRMSNorm (NVIDIA#1285) * [FusedRMSNorm doc] document where epsilon is added (NVIDIA#1295) * [FusedRMSNorm doc] add epsilon to formula * correct * better wording * Fix some bugs * Optimize HostRMSNormGradient and HostApplyRMSNorm for AMD GPUs * Fix NaN issues in FusedRMSNorm * Update test_fused_layer_norm.py * Skip test_fused_layer_norm.TestAutocastFusedRMSNorm on ROCm * Use at::cuda::warp_size() instead of at::cuda::getCurrentDeviceProperties()->warpSize Co-authored-by: eqy <eddiey@nvidia.com> Co-authored-by: Masaki Kozuki <masaki.kozuki.2014@gmail.com> Co-authored-by: Stas Bekman <stas00@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds the the missing epsilon to formula to match the code
It's actually very unlikely that the denominator will ever be zero in this class - unless each input is zero, since this is the root of sum of squares of numbers.
I don't know if it's faster to add epsilon than to check if all inputs are zero, since the output will be zero then.
@eqy